﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Disco.Ontology
{
    public enum AccessScope
    {
        /// <summary>
        /// Hides the Entity Set from the Web API.
        /// </summary>
        Internal,

        /// <summary>
        /// Exposes the Entity Set from the Web API.
        /// </summary>
        Public
    }

    [Flags]
    public enum AllowedOperations
    {
        None = 0,
        Create = 1,
        Read = 2,
        Update = 4,
        Delete = 8,
        All = Create | Read | Update | Delete
    }

    public class EntitySetAccessibilityAttribute : Attribute
    {
        public AccessScope Scope { get; set; }
        public AllowedOperations Operations { get; set; }

        public EntitySetAccessibilityAttribute(
            AccessScope scope = AccessScope.Public, 
            AllowedOperations operations = AllowedOperations.Read)
        {
            this.Scope = scope;
            this.Operations = operations;
        }
    }
}
